<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Error extends CI_Controller
{
	function __construct()
	{
		parent::__construct();
		$this->load->library('Mydatetime');
		$this->load->library('session');
		$this->load->model('error/error_model');
	}
    public function index()
	{
	   
        if(!$this->session->userdata('username'))
        {
            redirect(site_url('login'));
            die();
        }
        $data = array();
        $uid = $this->session->userdata('uid');
        
        $numrow = (int)$this->input->get('numrow') > 0 ? (int)$this->input->get('numrow') : 20;
        $page = (int)$this->input->get('page') > 0 ? (int)$this->input->get('page') : 1;
        
        $error = $this->error_model->ww_get_error_log_info($numrow, $page);

        $data['lsterror'] = $error['0'];
        $data['total'] = $error['1']['0']['total'];
        $data['current_page'] = $page;
        $data['max_page'] = round($data['total']/$numrow);
        
        
        // header
        
        // content
        $this->load->view('error/error_view', $data);
        
        // foter
    }
}